import { service } from '@/utils/request';

// 发送验证码
const sendvcode = ({ email }) => service.post('auth/sendvcode', { email });

// 用户注册
const register = ({
  name, email, vcode, password,
}) => service.post('auth/register', {
  name, email, vcode, password,
});

// 用户登录
const login = ({ email, password }) => service.post('auth/login', { email, password });

// 获取用户信息
const info = () => service.get('auth/info');

export default {
  sendvcode,
  register,
  login,
  info,
};
